<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1" import="java.util.*"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">

<%
Beverage[] beverageList;
%>
<%
beverageList=(Beverage[])session.getAttribute("BeverageList");
%>


<%@page import="com.burger.counter.beans.Beverage"%>

<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1;">
<title>Beverage Menu</title>
</head>
<body onload="document.beverage.Cart.disabled=true">
<script type="text/javascript">
function makeChoice()
{
	for( ids = 0; ids < document.beverage.BeverageData.length; ids++ )
	{
		if( document.beverage.BeverageData[ids].checked == true )
		{
			document.beverage.Cart.disabled=false;
		}
	}
}

</script>
<link rel="stylesheet" href="default.css" type="text/css"></link>
<%@ include file="header.jsp" %>

<form id ="beverage" name="dessert" method="POST" action="AddBeverageToCart" target ="leftFrame">
	<div>
		<%
			if(session.getAttribute("BeverageAdditionMessage")!= null)
			{ %>
			
				<label id ="Message" style="color: blue; size: 42;"> <%= session.getAttribute("BeverageAdditionMessage") %> </label>		
			<%
			session.removeAttribute("BeverageAdditionMessage");
			}
		%>		
	</div>
	<div class ="inputColumn" style="text-align: left; border: none; margin: auto;">	
		<table border="0" style="border-style: dashed">
		<tr>
		<th colspan="1" align="left" style="color:rgb(118,154,176)" bordercolor="red" >Starter Name </th>
		<th colspan="2" align="left" style="color:rgb(118,154,176)" bordercolor="red">Price ($)</th>
		</tr>
		
		
		<% for(int i=0;i<beverageList.length;i++)
		{
		%>
		<tr bordercolor="red" style="border-style: none" bordercolor="white">
		  <td bordercolor="red" bordercolor="white">
			<input type="radio" value='<%=beverageList[i].getBeverageId()%>' 
							name="BeverageData" onclick="makeChoice();"/>
			<%
				String str =beverageList[i].getBeverageName();
			%>
			<img src= "image/<%=str%>.jpg" align="left" height="30" width="30" />
			<%=beverageList[i].getBeverageName()%>
			
			</td>
		<td bordercolor="red">
			<label style="size: 25;"><%=beverageList[i].getBeveragePrice()%></label>
		</td>
		</tr>
		<%
			}
		%>
		<tr align="right">
		<td></td>
							
		<td align="right">
		<input id = "Cart" type="submit" value="Add to Cart" name="Add to Cart" onclick="window.parent.rightFrame.location.reload();" style="background-color: lightblue">
		</td>
		</tr>
	</table>
	
</div>
</form>
</body>
</html>